package com.xjrsoft.module.workflow.service;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xjrsoft.common.page.PageOutput;
import com.xjrsoft.core.secure.XjrUser;
import com.xjrsoft.module.base.dto.GetPageListDto;
import com.xjrsoft.module.base.entity.XjrBaseUser;
import com.xjrsoft.module.workflow.dto.NwfRelationDto;
import com.xjrsoft.module.workflow.entity.XjrNwfRelation;
import com.xjrsoft.module.workflow.vo.NwfRelationVo;

import java.util.List;

/**
* @Author:湘北智造-框架开发组
* @Date:2020/11/2
* @Description:流程关联服务类
*/
public interface IXjrNwfRelationService extends IService<XjrNwfRelation> {

    /**
    * @Author:湘北智造-框架开发组
    * @Date:2020/11/2
    * @Param:[idValue, type]
    * @return:java.util.List<java.lang.String>
    * @Description:根据主键ID获取流程模板ID
     * type:1-step4:流程信息
     * 	 	2-step5:模板权限
     * 	 	3-step6:字段权限
    */
//    JSONObject getSettingJsonById(String idValue);

    /**
    * @Author:湘北智造-框架开发组
    * @Date:2021/2/20
    * @Param:[idValue]
    * @return:com.alibaba.fastjson.JSONArray
    * @Description:获取专项菜单绑定的流程id
    */
    JSONArray getNwfSchemeInfoIds(String idValue);

    /**
    * @Author:湘北智造-框架开发组
    * @Date:2020/11/2
    * @Param:[idValue]
    * @return:java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
    * @Description:根据主键ID获取设置的表单字段名
    */
    JSONArray getFormFieldById(String idValue);

     JSONArray getSearchFieldById(String idValue,String queryParameter);

    JSONObject getPageInfoById(String idValue);

    /**
    * @Author:湘北智造-框架开发组
    * @Date:2020/11/9
    * @Param:[schemeInfoId]
    * @return:java.util.List<com.xjrsoft.module.workflow.entity.XjrNwfRelation>
    * @Description:根据流程模板信息id获取
    */
    List<XjrNwfRelation> getBySchemeInfoId(String schemeInfoId);

    /**
    * @Author:湘北智造-框架开发组
    * @Date:2020/11/9
    * @Param:[]
    * @return:com.xjrsoft.common.page.PageOutput
    * @Description:
    */
    PageOutput<NwfRelationVo> queryNwfRelation(GetPageListDto dto);

    String addNwfRelation(NwfRelationDto dto, XjrUser currentUser);

    boolean updateNwfRelation(String id, NwfRelationDto dto, XjrUser currentUser) throws Exception;

    JSONArray getNwfFormInfo(String nwfSchemeInfoId);

    JSONArray getTableFieldList(String nwfSchemeInfoId);

    boolean deleteNwfRelation(String id) throws Exception;

    boolean checkFieldAuthority(String nwfRelationId, String currentUserId,List<XjrBaseUser> xjrBaseUserlist);

    boolean checkTemplateAuthority(String nwfRelationId, String currentUserId);
}
